import axios from 'axios'

export default {
    async getCode(baseUrl, code, Token) {
        try {
            const {
                data
            } = await axios({
                method: 'post',
                baseURL: baseUrl,
                url: 'admin/dict/list',
                data: {
                    access_token: Token,
                    code: code,
                    // IsOpen:1
                }
            })
            if (data.ErrorCode == 0) {
                return data.Data
            } else {
                console.error(data.ErrorMsg)
            }
        } catch (e) {
            console.error('网络异常：', e)
        }
        return null
    },
    getUrl(attachmentID) {
     let urls =  '/api/stationery?attachmentId=' + attachmentID
    return urls
    },
    getArr(img) {
    var list = img.split(',')
    var imgString = list.length > 0 ? list[0] : ''
    console.log("common.getArr(scope.row.coverImg)",imgString);
    
    return imgString
  },
}
